Skip to content

Conversation

@adriaanm
Copy link
Contributor

There are two axes regarding the required or supported JVM version:

  • running Scala code,
  • compiling Scala code,

and on both there is a lower and upper bound of the supported JVM.

There are two axes regarding the required or supported JVM version: 
  - running Scala code, 
  - compiling Scala code,

and on both there is a lower and upper bound of the supported JVM.
@adriaanm adriaanm requested review from SethTisue and retronym March 22, 2018 12:26
### Running versus compiling and required / supported JVM
For most users, we recommend using Java 8 for *compiling* (and running) Scala code. Since the JVM is backward compatible, it is usually safe to use a newer JVM to *run* your code compiled by the Scala compiler for older JVM versions. There are notable exceptions with experimental/unsafe features, and the introduction of the module system in Java 9. The Scala compiler does usually need updates to run properly on newer versions of the JVM, so make sure to use the appropriate JVM when compiling your code.

Issues with using the Scala compiler on *non-LTS* versions of Java will not necessarily be considered blockers for releases, but we will do our best to run CI on more versions of Java to catch bugs early, and to fix them as quickly as reasonably possible. If regressions do occur with non-LTS (or, generally, unsupported) versions of Java, we may bring the next minor release deadline a bit closer, so that these issues are generally resolved within a month or two. Lightbend does offer commercial support for faster resolution of issues like this.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should define "LTS".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in dce41f9

| 6 | 2.11.0, 2.10.0 |

### Running versus compiling and required / supported JVM
For most users, we recommend using Java 8 for *compiling* (and running) Scala code. Since the JVM is backward compatible, it is usually safe to use a newer JVM to *run* your code compiled by the Scala compiler for older JVM versions. There are notable exceptions with experimental/unsafe features, and the introduction of the module system in Java 9. The Scala compiler does usually need updates to run properly on newer versions of the JVM, so make sure to use the appropriate JVM when compiling your code.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This limits the user from being able to call Java 9 APIs. Perhaps we should be explicit about that restriction.

@retronym
Copy link
Member

There are probably more steps in our support.

  1. Code that was compiled against and with JDK8 may be executed with Java 9+
  2. JDK9+ may be used as the development JDK, which will allow calls to @since 9 APIs. However, the Scala compiler does not enforce JPMS module system.
  3. The Scala compiler understands JPMS, and will flag errors when calling non-exported APIs, both for the java.base module and third party libraries on the module path.
  4. The Scala standard library and scala-xml, etc are equipped with the metadata to be used as JPMS modules.

These might require a blog to articulate and relate to our roadmap, so the approximation you've started with could be enough for this document.

@SethTisue
Copy link
Member

Jason has made some suggestions that aren't addressed, but I suggest we merge anyway since this is topical right now because of the regression in 2.12.5. We can always improve it more later.

This table shows the first Scala release in each series that works with each JVM release.

| JVM version | First Scala compiler release supported to run on this JVM |
| JVM version | Minimum Scala versions |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to me specifying "compiler" here was helpful..

@retronym retronym merged commit 950f8d3 into master Mar 30, 2018
@retronym
Copy link
Member

I'll loop back to update this to complement my forthcoming blog on the topic.

@SethTisue SethTisue deleted the jdk-OSS-support-policy branch March 30, 2018 04:08
## JDK 9 compatibility notes
## Running versus compiling

For most users, we still recommend using Java 8 for *compiling* (and running) Scala code. Since the JVM is backward compatible, it is usually safe to use a newer JVM to *run* your code compiled by the Scala compiler for older JVM versions. There are notable exceptions with experimental/unsafe features, and the introduction of the module system in Java 9. The Scala compiler does usually need updates to run properly on newer versions of the JVM, so make sure to use the appropriate JVM when compiling your code.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest removing the parenthesis in (and running).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants